import request from '@/utils/request'

// 获取全部（各个产废单位）转运计划List 分页
export const getTransportPlanList = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetAllCompanyTransferPlanList',
    method: 'get',
    params: params
  })
}

// 查看转运计划详情
export const getTransportPlanInfoById = id => {
  return request({
    url: `/SeriesRAPI/HazardousWaste/GetTransferPlans?id=${id}`,
    method: 'get',
  })
}

export const approval = (data) => {
  return request({
    url: "/SeriesRAPI/HazardousWaste/BatchUpdateTransferPlanStatus",
    method: 'post',
    data
  })
}

// 得到转运计划包含的废物库List
export const getTransportPlanWastList = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetTransferPlanByHwList',
    method: 'get',
    params: params
  })
}

// 得到转运申请List
export const getTransportApplyList = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetTransferApplyList',
    method: 'get',
    params: params
  })
}
// 得到转运申请单包含的废物库List
export const getApplyWastList = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetTransferApplyByHwList',
    method: 'get',
    params: params
  })
}
// 查看转运申请详情
export const getTransportApplyInfoById = id => {
  return request({
    // todo
    url: `/SeriesRAPI/HazardousWaste/GetTransferApplys?id=${id}`,
    method: 'get',
  })
}
// 获取 出库记录List（不分页）
// 过滤：登录用户组织；
// 查询条件：至少包含：转运申请ID、转运申请包含的废物库ID

export const GetAllHWInoutrecordList = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetAllHWInoutrecordList',
    method: 'get',
    params: params
  })
}
// 获取 出库记录List（不分页）
// 过滤：登录用户组织；
// 查询条件：至少包含：转运申请ID、转运申请包含的废物库ID,没有组织过滤

export const GetAllHWInoutrecordListTwo = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetAllHWInoutrecordListTwo',
    method: 'get',
    params: params
  })
}

// 新联单： 获取废物转运联单列表 (分页)
export const GetHWReceiptList = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetHWReceiptList',
    method: 'get',
    params: params
  })
}

// 新联单： 根据废物联单ID查询废物联单详情
export const GetHWReceipts = id => {
  return request({
    url: `/SeriesRAPI/HazardousWaste/GetHWReceipts?id=${id}`,
    method: 'get',
  })
}

// 新联单： 根据废物联单ID查询关联的废物实体列表(分页)
export const GetHWReceiptByHwList = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetHWReceiptByHwList',
    method: 'get',
    params: params
  })
}
// 获取所有废物实体List，不分页，四合一定位查询

export const GetAllHazardousWasteLibraryList = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetAllHazardousWasteLibraryList',
    method: 'get',
    params: params
  })
}

// 获取转运申请关联的废物实体全部数据

export const GetAllTransferApplyByHwLibList = params => {
  return request({
    url: '/SeriesRAPI/HazardousWaste/GetAllTransferApplyByHwLibList',
    method: 'get',
    params: params
  })
}
